package com.cskaoyan.day8;

public class Staff {
    String name;
    String gender;
    int id = 1000;
    double salary;
    static int count = 1;

    {
        id += count++;
    }

    public Staff(String name, String gender) {
        this.name = name;
        this.gender = gender;
    }

    public Staff(String name, String gender, double salary) {
        this.name = name;
        this.gender = gender;
        this.salary = salary;
    }

    double lastSalar() {
        return salary - 2000;
    }

    @Override
    public String toString() {
        return "Staff{" +
                "name='" + name + '\'' +
                ", gender='" + gender + '\'' +
                ", id=" + id +
                ", salary=" + salary +
                '}' + "实际到手工资" + lastSalar();
    }

    public static void main(String[] args) {
        Staff staff = new Staff("张三", "男", 10000);
        Staff staff1 = new Staff("里斯", "男", 12000);
        Staff staff2 = new Staff("王五", "男", 20000);
        Staff staff3 = new Staff("小红", "女", 8000);
        System.out.println(staff.toString());
        System.out.println(staff1.toString());
        System.out.println(staff2.toString());
        System.out.println(staff3.toString());
    }
}
